package com.min.task;

import java.util.Calendar;
import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by min on 2017/6/9.
 */
public class TaskTest {

    public static void main(String[] args) {

        Calendar instance = Calendar.getInstance();
        instance.setTimeInMillis(System.currentTimeMillis()+1000*5);
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                System.out.println("执行...");
                try {
                    Thread.sleep(1000*10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },instance.getTime(),1000*5);
    }
}
